<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">   
<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">   
<script type="text/javascript" src="easyui/jquery.min.js"></script>   
<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script> 
</head>

<body style="background-image: url('image/bg.jpg');">
	<div id="box">
	<form action="loginpost" id="fm" method="post">
		<div style="height: 50px;padding-top: 10px;padding-left:10px">   
	        <label for="name" style="font-size: 15px">账号:</label>   
	        <input id="name" class="easyui-textbox" type="text" name="email" data-options="iconCls:'icon-user'" style="width: 200px;height:25px;"/>   
	    </div>   
	    <div style="height: 40px;padding-left:10px">   
	        <label for="password" style="font-size: 15px">密码:</label>   
	       <input id="pwd" class="easyui-textbox" type="password" data-options="iconCls:'icon-pwd'" name="login_password" style="width: 200px;height:25px;">    
	    </div> 
	</form>
	</div>  
</body>
<script type="text/javascript">
$(
	function(){
		$('#box').dialog({    
			  width:280,    
			  height:180, 
			  title: '登录', 
			  closable:false,
			  draggable:false,
			  buttons:[{
					text:'登录',
					handler:function(){
						var a=$("#fm").form("validate");
						if(a){
							$("#fm").form("submit",{
								success:function(data){
									if(data=="indexExam"){
										window.location.href=data;
									}
								}
							});
						}else{
							alert("账号和密码不能为空");
						}
					}
				},{
					text:'注册',
					handler:function(){}
				}]
			}); 
	}		
)
$(function(){
	$('#name').validatebox({    
	    required: true, 
	    invalidMessage:"请输入用户名或者邮箱"
	});
	$('#pwd').validatebox({    
	    required: true,    
	    invalidMessage:"请输入密码"
	});
})

 
</script>
</html>